
    <!--content-->

    <!-- 悬浮导航 -->
     <div class="speOffer-LeftFix">
        <div class="speOffer-Left-logo">
            <a href="<?php echo $this->createUrl('/front/index/index')  ?>" title="妈咪街">
                <img src="<?php echo yii::app()->theme->baseUrl;  ?>/assets/images/speOffer_logo.png" alt=""/>
            </a>
        </div>
        <ul>
            <li class="speOffer-A"><a href="<?php  echo $this->createUrl('/front/index/goods', array('cid' => 1)) ?>" title="妈咪街宝宝用品">宝宝用品</a></li>
            <li class="speOffer-B"><a href="<?php  echo $this->createUrl('/front/index/goods', array('cid' => 15)) ?>" title="妈咪街童装童鞋">童装童鞋</a></li>
            <li class="speOffer-C"><a href="<?php  echo $this->createUrl('/front/index/goods', array('cid' => 22)) ?>" title="妈咪街玩具学习">玩具学习</a></li>
            <li class="speOffer-D"><a href="<?php  echo $this->createUrl('/front/index/goods', array('cid' => 36)) ?>" title="妈咪街宝宝食品">宝宝食品</a></li>
            <li class="speOffer-E"><a href="<?php  echo $this->createUrl('/front/index/goods', array('cid' => 29)) ?>" title="妈咪街妈咪专区">妈咪专区</a></li>
        </ul>
        <div class="speOffer-LeftFix-B">
            <img src="<?php echo yii::app()->theme->baseUrl;  ?>/assets/images/speOffer_totop.png" alt=""/>
        </div>
    </div>
    <div class="speOffer-topFix">


          <?php 

          $this->widget('zii.widgets.CMenu',array(
                  'items'=>$menus,
                  'encodeLabel' => FALSE,
                  'lastItemCssClass'=>'qdLI',
                  'htmlOptions' => array('class' => 'clearfix', 'id' => 'menus'),
                  'activeCssClass' => 'speOfferNavActive',
          ));
        
           ?>

           <script type="text/javascript">
            $(function(){
                $("#menus").append('<div class="speOffer-topFixBg"></div>');
            })
           </script>



    </div>
    <div class="speOfferF">
        <div class="speOfferF-content clearfix" id="speOfferFB">
            <div class="produSelectNav speOfferF-nav clearfix">
                <ul class="produSelectNavL speOfferF-Select-NavL clearfix">


                <li class="order_1" >
                   <a href="<?php  echo $this->createUrl('onsale', array('cid' => $cid, 'order' => 1)) ?>"><span>销量</span><em></em></a>                
                </li>
                <li class="order_2 order_3" >
                   <?php  if($order == 2){$o = 3;}else{$o = 2;}  ?>
                   <a href="<?php  echo $this->createUrl('onsale', array('cid' => $cid, 'order' => $o)) ?>"><span>价格</span><em id="speOfferFPrice"></em></a>                
                </li>
                <li class="order_4" >
                   <a href="<?php  echo $this->createUrl('onsale', array('cid' => $cid, 'order' => 4)) ?>"><span>人气</span><em></em></a>                
                </li>

                <li class="order_6" >
                   <a href="<?php  echo $this->createUrl('onsale', array('cid' => $cid, 'order' => 6)) ?>"><span>折扣</span><em id="speOfferFOff"></em></a>                
                </li>
                </ul>
                <script type="text/javascript">
                    $(function(){
                        var order = '<?php echo $order; ?>';
                        $(".order_"+order).addClass('speOffer-active');
                    })
                </script>
                
                <ul class="speOfferF-Select-add">
                    <li>
                        <a href="<?php  echo $this->createUrl('onsale', array('cid' => $cid, 'extra' => 1)) ?>" title="妈咪街">9.9包邮</a>
                    </li>
                    <li>
                        <a href="<?php  echo $this->createUrl('onsale', array('cid' => $cid, 'extra' => 2)) ?>" title="妈咪街">19.9包邮</a>
                    </li>
                </ul>
                <div class="speOfferF-nav-r">
                    <div class="speOfferF-nr-arrow clearfix">
                        <a href="<?php echo $data['page']->createPageUrl($this,$page-2) ?>" class="speOfferF-arrowL">
                            <em></em>
                        </a>
                        <a href="<?php echo $data['page']->createPageUrl($this,$page) ?>" class="speOfferF-arrowR">
                            <em></em>
                        </a>
                    </div>
                    <p>每天9点更新，共<em id="good_count" ><?php echo $data['count'];  ?></em>个商品<span><?php echo $page  ?>/<?php echo $data['page']->getPageCount() ?></span></p>
                </div>
            </div>
            <div class="spe-offer-goods speOfferG clearfix" id="speOfferGoods">
            <div class="spe-offer-goods-over speOffer-goods speOfferGoods clearfix">
                <?php include $this->getViewFile('data') ?>
            </div>
            </div>
        <?php
        if(!empty($data['page'])){
            $this->widget('CLinkPager', array(
                'header' => "",
                'firstPageLabel' => '首页',
                'lastPageLabel' => '末页',
                'prevPageLabel' => '上一页',
                'nextPageLabel' => '下一页',
                'pages' => $data['page'],
                'footer' => "<span>共<em>{$data['page']->pageCount}</em>页</span>",
                'maxButtonCount' => 8
                    )
            );
        }
        ?>

        </div>




    </div>
    <script src="<?php echo yii::app()->theme->baseUrl;  ?>/assets/js/speOfferF.js"></script>

    <script type="text/javascript">
        $(function(){
            //收藏
            $(document).on('click', '.collect', function(){
            //$(".collect").click(function(){
                var obj = $(this);
                var id = obj.data('id');
                $.post('<?php echo $this->createUrl('/front/goods/collect') ?>',{id:id},function(data){
                    if(data.status){
                        obj.find('strong').html(data.number);
                    }else{
                        alert(data.info);
                    }
                },'json')
            })
            //滚动的时候事件
           HomePageAjax();  
           $(window).on('scroll', function(){
           //$(window).scroll(function() {
               var he = $(document).scrollTop() / $(document).height();
               if (he > 0.20) {
                   HomePageAjax();
               }
           });                  
        })

        var URL = '<?php echo $this->createUrl(ACTION_NAME) ?>';
        var PAGE = 1;
        var CID = '<?php echo $cid; ?>';
        var _isAjaxsuo = false;
        function HomePageAjax(){
            console.log(PAGE);
            if (_isAjaxsuo) {
                return false;
            }
            _isAjaxsuo = true;
            $.ajax({
                url: URL,
                type: "post",
                timeout: 5000,
                dataType: "json",
                data:{page:PAGE,cid:CID},
                success: function(data) {
                    console.log(data);
                    if(data.status){
                        if(data.content == ''){
                            $(window).off('scroll');
                            //注销事件
                        }
                        $(".spe-offer-goods-over").append(data.content);
                        PAGE++;
                        _isAjaxsuo = false;  
                    }
                }
            });     
        }
    </script>    